﻿using System;
using System.Collections.Generic;

namespace IOA.MES.Client.Models.Response
{
    public class ViaSiteResponse
    {
        /// <summary>
        /// 产量
        /// </summary>
        public int Output { get; set; }

        /// <summary>
        /// 班次ID
        /// </summary>
        public int DutyId { get; set; }

        /// <summary>
        /// 标片测试结果
        /// </summary>
        public StandardTestResult StandardTestResult { get; set; }

        /// <summary>
        /// 工单BOM
        /// </summary>
        public List<WorkOrderBom> Boms { get; set; } = new List<WorkOrderBom>();

        /// <summary>
        /// 过站记录
        /// </summary>
        public ViaSiteRecord ViaSiteRecord { get; set; }

        /// <summary>
        /// IV数据
        /// </summary>
        public IVData IVData { get; set; }

        /// <summary>
        /// 打印标签列表
        /// </summary>
        public List<KeyValuePair<string, string>> Labels { get; set; } = new List<KeyValuePair<string, string>>();

        /// <summary>
        /// 分拣数据
        /// </summary>
        public List<SortStack> SortStacks { get; set; } = new List<SortStack>();
    }

    /// <summary>
    /// 标片测试结果
    /// </summary>
    public class StandardTestResult
    {
        /// <summary>
        /// 是否通过
        /// </summary>
        public bool Pass { get; set; }

        /// <summary>
        /// 异常信息
        /// </summary>
        public string ErrMsg { get; set; }
    }

    /// <summary>
    /// 工单BOM
    /// </summary>
    public class WorkOrderBom
    {
        /// <summary>
        /// 料号
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        public string BatchNo { get; set; }

        /// <summary>
        /// 扣料数量
        /// </summary>
        public decimal BomCount { get; set; }

        /// <summary>
        /// 库存余量
        /// </summary>
        public decimal RemainCount { get; set; }
    }

    /// <summary>
    /// IV数据
    /// </summary>
    public class IVData
    {
        /// <summary>
        /// 组件条码
        /// </summary>
        public string BarCode { get; set; }

        /// <summary>
        /// 组件条码
        /// </summary>
        public decimal? PowerLevel { get; set; }

        /// <summary>
        /// 组件条码
        /// </summary>
        public string CurrentLevel { get; set; }

        /// <summary>
        /// 实际功率
        /// </summary>
        public decimal? Pmax { get; set; }
    }

    /// <summary>
    /// 过站记录
    /// </summary>
    public class ViaSiteRecord
    {
        /// <summary>
        /// 序号
        /// </summary>
        public int No { get; set; }

        /// <summary>
        /// 组件条码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 工单号
        /// </summary>
        public string WorkOrderNo { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string MachineName { get; set; }

        /// <summary>
        /// 层压机台
        /// </summary>
        public string TopMachine { get; set; }

        /// <summary>
        /// 层压位置
        /// </summary>
        public string TopPosition { get; set; }

        /// <summary>
        /// 组件等级
        /// </summary>
        public string QLevel { get; set; }

        /// <summary>
        /// 异常原因
        /// </summary>
        public string BadReason { get; set; }

        /// <summary>
        /// 班次名称
        /// </summary>
        public string DutyName { get; set; }

        /// <summary>
        /// 操作员
        /// </summary>
        public string Operator { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public string OperateTime { get; set; }

        /// <summary>
        /// 防伪码
        /// </summary>
        public string VerifyCode { get; set; }

        /// <summary>
        /// 不良位置
        /// </summary>
        public string BadCoordinates { get; set; }
    }
}
